package cn.hznc.controller.schedule;

import cn.hznc.controller.service.schedule.ToolSchedulingHomepageService;
import cn.hznc.domain.entity.NameNumberEntity;
//import cn.hznc.domain.entity.PersonnelUsageAnalysisEntity;
//import cn.hznc.domain.request.toolAnalyze.PersonnelUsageAnalysisReq;
import cn.hznc.domain.request.toolAnalyze.ToolQuantityMachineToolsReq;
import cn.hznc.domain.response.ResponseBody;
import cn.hznc.vo.PersonnelKnifeInstallationVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@CrossOrigin(origins = "*", maxAge = 3600)
@RequestMapping("/toolSchedulingHomepage")
public class ToolSchedulingHomepageController {
    @Resource
    private ToolSchedulingHomepageService toolSchedulingHomepageService;

    @RequestMapping(value = "/queryPersonnelKnifeInstallation", method = RequestMethod.GET)
    public ResponseBody<List<NameNumberEntity>> queryPersonnelKnifeInstallation(){
        return ResponseBody.success(toolSchedulingHomepageService.queryPersonnelKnifeInstallation());
    }

    @RequestMapping(value = "/queryPersonnelKnifeInstallation2", method = RequestMethod.GET)
    public ResponseBody<List<NameNumberEntity>> queryPersonnelKnifeInstallation2(){
        return ResponseBody.success(toolSchedulingHomepageService.queryPersonnelKnifeInstallation2());
    }
    @RequestMapping(value = "/queryProductKnifeUsage", method = RequestMethod.GET)
    public ResponseBody<List<PersonnelKnifeInstallationVo>> queryProductKnifeUsage(){
        return ResponseBody.success(toolSchedulingHomepageService.queryProductKnifeUsage());
    }

    @RequestMapping(value = "/queryAllMachineTool", method = RequestMethod.GET)
    public ResponseBody<List<String>> queryAllMachineTool(){
        return ResponseBody.success(toolSchedulingHomepageService.queryAllMachineTool());
    }

    @org.springframework.web.bind.annotation.ResponseBody
    @RequestMapping(value = "/queryToolQuantityMachineTools", method = RequestMethod.POST)
    public ResponseBody<List<NameNumberEntity>> queryToolQuantityMachineTools(@RequestBody ToolQuantityMachineToolsReq toolQuantityMachineToolsReq){
        return ResponseBody.success(toolSchedulingHomepageService.queryToolQuantityMachineTools(toolQuantityMachineToolsReq));
    }
}
